
package com.verify.repository;

import com.baomidou.mybatisplus.extension.service.IService;
import com.verify.data.domain.JobLevel;
import com.verify.data.domain.JobType;
import com.verify.data.domain.PositionDict;
import com.verify.mapper.JobLevelMapper;
import com.verify.mapper.PositionDictMapper;
import com.verify.repository.base.BaseRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class PositionDictRepository extends BaseRepository<PositionDictMapper, PositionDict>
        implements IService<PositionDict> {
    public List<PositionDict> listByOrgCode(String orgCode) {
        return list(baseQuery().eq(PositionDict::getOrgCode, orgCode));
    }

    public PositionDict getByName(String name,String type, String orgCode) {
        return getOne(baseQuery().eq(PositionDict::getCompanyPositionDictionaryName, name).eq(PositionDict::getCompanyPositionTypeName, type).eq(PositionDict::getOrgCode, orgCode));
    }

    public List<PositionDict> listByType(String positionType, String orgCode) {
        return list(baseQuery().eq(PositionDict::getCompanyPositionTypeName, positionType).eq(PositionDict::getOrgCode, orgCode));
    }
}
